/**
 * Created by zhangqingxi on 2017-04-01.
 */

$(function () {


    deptLoadSuccess();
    solidWasteTypeLoadSuccess();

    initShape();
    initGenerationSource();

    $('#btn_verify').on('click', function () {

        var index = layer.confirm('是否确定提交，提交之后不可编辑？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $('#submit_form').form('submit', {
                url: modelPath + 'verify.shtml',
                onSubmit: function (param) {
                    var isValid = $(this).form('validate');
                    if (!isValid) {
                        layer.close(index);
                        layer.msg("请正确填写表单")
                    }
                    param["auditState"] = 7;
                    return $(this).form('validate');
                },
                success: function (result) {
                    var data = $.parseJSON(result);
                    successCallback(data)
                }
            });
        });

    });

});